Add getter for font description in GtkThemingEngine
authorCarlos Garnacho <carlosg@gnome.org>
Mon, 13 Dec 2010 20:36:49 +0000 (21:36 +0100)
committerCarlos Garnacho <carlosg@gnome.org>
Mon, 13 Dec 2010 21:31:30 +0000 (22:31 +0100)
This function is analogous to gtk_style_context_get_font().

gtk/gtkthemingengine.c

index e3cde59e24c1f4f5914ce70c692d495ba4b75b84..7914029602311e516816dbdc49f18f3ec4d29a8c 100644 (file)
@@ -874,6 +874,29 @@ gtk_theming_engine_get_margin (GtkThemingEngine *engine,
   gtk_style_context_get_margin (priv->context, state, margin);
 }
 
+/**
+ * gtk_theming_engine_get_font:
+ * @engine: a #GtkThemingEngine
+ * @state: state to retrieve the font for
+ *
+ * Returns the font description for a given state.
+ *
+ * Returns: the #PangoFontDescription for the given state. This
+ *          object is owned by GTK+ and should not be freed.
+ *
+ * Since: 3.0
+ **/
+const PangoFontDescription *
+gtk_theming_engine_get_font (GtkThemingEngine *engine,
+                             GtkStateFlags     state)
+{
+  GtkThemingEnginePrivate *priv;
+
+  g_return_val_if_fail (GTK_IS_THEMING_ENGINE (engine), NULL);
+
+  priv = engine->priv;
+  return gtk_style_context_get_font (priv->context, state);
+}
 
 /* GtkThemingModule */